/*
 *  Copyright (c)  09.04.2007 Philipp Marx.
 *  Permission is granted to copy, distribute and/or modify this document
 *  under the terms of the GNU Free Documentation License, Version 1.2
 *  or any later version published by the Free Software Foundation;
 *  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 *  A copy of the license is included in the section entitled "GNU
 *  Free Documentation License".
 */

package de.smigfu.irc.exception;

import java.io.IOException;

/**
 * A <code>ServerCommunicationException</code> encapsulates an <code>IOException</code>. For every
 * <code>ServerCommunicationException</code> a description is provided which indicates the problem.
 *
 * @version $Revision$ $Date$
 *
 * @author Philipp Marx, last modified by $Author$
 */
public class ServerCommunicationException extends Exception {

   /** serialVersionUID */
   private static final long serialVersionUID = -8882318303772872671L;

   /** The description */
   private String description = null;

   /**
    * Constructs a <code>ServerCommunicationException</code>.
    *
    * @param cause The cause <code>IOException</code>.
    * @param description The description.
    */
   public ServerCommunicationException(IOException cause, String description) {
      super(cause);

      this.description = description;
   }

   /**
    * Returns the description.
    * 
    * @return The description.
    */
   public String getDescription() {
      return this.description;
   }

   /**
    * Returns the encapsulated <code>IOException</code>.
    * 
    * @return The encapsulated <code>IOException</code>.
    */
   public IOException getIOException() {
      return (IOException) this.getCause();
   }

}
